package com.suray.wcs.service.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.suray.commin.annotation.Excel;
import com.suray.commin.core.utils.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("wcs_interface_log")
public class InterfaceLogDB extends BaseModel implements Serializable {

    private static final long serialVersionUID = -8247913716050794361L;

    @TableId(value = "interface_log_id", type = IdType.AUTO)
    private Integer interfaceLogId;     // 接口日志主键id

    private Integer taskId;     // 任务编号

    private String deviceName;      // 设备名称

    private String sender;      // 发送源

    private String recipient;      // 接收源

    @Excel(name = "接口方法描述")
    private String interfaceMethodDes;      // 接口方法描述

    @Excel(name = "接口传入参数")
    private String interfaceParamsIn;       // 接口传入参数

    @Excel(name = "接口返回参数")
    private String interfaceParamsRet;      // 接口返回参数

    @Excel(name = "发送时间")
    private Date sendTime;      // 发送时间

    @TableField(exist = false)
    private Date sendTimeStart; // 发送时间开始

    @TableField(exist = false)
    private Date sendTimeEnd;   // 发送时间结束

    private Date receTime;      // 接收时间

    private Long useTime;       // 消耗时间

    /*
    * 根据相应状态  判断接口操作状态0 - 城功   1 - 失败
    * */
    @Excel(name = "操作状态", readConverterExp = "0=成功,1=失败")
    private Integer status;


    @Override
    public String toString() {
        return "InterfaceLogdb{" +
                "interfaceLogId=" + interfaceLogId +
                ",taskId=" + taskId + '\'' +
                ",deviceName=" + deviceName + '\'' +
                ", sender='" + sender + '\'' +
                ", recipient='" + recipient + '\'' +
                ", interfaceMethodDes='" + interfaceMethodDes + '\'' +
                ", interfaceParamsIn='" + interfaceParamsIn + '\'' +
                ", interfaceParamsRet='" + interfaceParamsRet + '\'' +
                ", sendTime=" + sendTime +
                ", receTime=" + receTime +
                ", useTime=" + useTime +
                ", state=" + status +
                '}';
    }
}
